<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<html>
<head>
    <title>用户登陆</title>
    <link rel="stylesheet" href="layui/css/layui.css">
    <style>
        #asd{
            width: 580px;
            height: 350px;
            border: #0C0C0C solid 1px;
            margin: auto;
            margin-top: 200px;
            background-color: #93D1FF;
        }
        #as{
            margin-top: 100px;
            margin-left: 80px;
        }
    </style>
</head>
<body>
<div id="asd">
    <form class="layui-form" action="userServlet" id="as">
        <div class="layui-form-item">
            <label class="layui-form-label">输入框</label>
            <div class="layui-input-inline">
                <input type="text" name="username" required  lay-verify="required" placeholder="请输入账号" autocomplete="off" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码框</label>
            <div class="layui-input-inline">
                <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
</body>
<script src="layui/layui.all.js"></script>
<script>
    layui.use('form', function(){
        var form = layui.form;
        //监听提交
        form.on('submit(formDemo)', function(data){
            layer.msg(JSON.stringify(data.field));
        });
    });
</script>
</html>